﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="order_product.aspx.cs" Inherits="RastinArgham.CRM.Web.order_product" %>
<%@ Import Namespace="Mani.Common" %>
<%@ Register src="ContactInfo.ascx" tagname="ContactInfo" tagprefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h3 class="ui-widget-header">
            <asp:Literal ID="lbtitle" runat="server" Text="لیست و خرید کالا" />
    </h3>

    <div class="space2"></div>

    <uc1:ContactInfo ID="ContactInfo1" runat="server" />

    <div class="space2"></div>

    <div class="ui-layout-content ui-widget-content">
        <mani:PagingGridView ID="gvOrders" runat="server" AutoGenerateColumns="false" 
            GridLines="None" DataKeyNames="OrderId" AllowPaging="true" PageSize="25" 
            onrowdatabound="gvOrders_RowDataBound" onrowcommand="gvOrders_RowCommand">
           <Columns>
                <asp:BoundField HeaderText="کد" DataField="OrderId" />
                <asp:BoundField HeaderText="کالا" DataField="ProductName" />
                <asp:TemplateField HeaderText="تاریخ سفارش">
                    <ItemTemplate>
                        <%# Convert.ToDateTime(Eval("OrderDate")).ToJalali() %>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="هزینه کالا">
                    <ItemTemplate>
                        <%# UIHelper.FormatString(Eval("Price")) %>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="مالیات ( درصد )">
                    <ItemTemplate>
                         % <%# Eval("TaxPercent") %>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="مبلغ کل ( ریال )">
                    <ItemTemplate>
                        <%# UIHelper.FormatString(Eval("TotalPrice")) %>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField HeaderText="وضعیت" DataField="Status" />
                <asp:BoundField HeaderText="کد پرداخت" DataField="PaymentCode" />
                <asp:BoundField HeaderText="شناسه کاربری" DataField="SubID" />
                <asp:TemplateField HeaderText="سریال کالا">
                    <ItemTemplate>
                        <a href='order_product.aspx?mode=edit&id=<%= Request.QueryString["id"]%>&OrderId=<%# Eval("OrderId") %>'>
                            <%# Eval("Serial") %>
                        </a>
                    </ItemTemplate>
                </asp:TemplateField>

                <asp:BoundField HeaderText="آخرین اپرتور" DataField="OperatorName" />

                <asp:TemplateField HeaderText="ویرایش">
                    <ItemTemplate>
                       <a href='order_product.aspx?id=<%= Request.QueryString["id"]%>&OrderId=<%# Eval("OrderId") %>'>
                              <img src="/App_Themes/<%=Page.Theme %>/images/edit.gif" alt="" style="border:0;" />
                       </a>
                    </ItemTemplate>
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="عملیات">
                    <ItemTemplate>
                        <asp:LinkButton ID="lbLink1" Visible="false" runat="server" />
                        <asp:LinkButton ID="lbLink2" Visible="false" runat="server" />
                        <asp:LinkButton ID="lbLink3" Visible="false" runat="server" />
                        <asp:LinkButton ID="lbLink4" Visible="false" runat="server" />
                    </ItemTemplate>
                </asp:TemplateField>
           </Columns>
        </mani:PagingGridView>

        <div class="space2"></div>

        <hr />

        <asp:Panel ID="pnlOrderProduct" runat="server">

            <h4 class="ui-widget-header">
                <asp:Label ID="lblTitle" runat="server">
                    سفارش کالا  
                </asp:Label>
            </h4>
        
            <div class="space2"></div>

            <table>

                <tr>
                    <td>کد سفارش</td>
                    <td>
                        <asp:TextBox ID="txtOrderId" runat="server" ReadOnly="true" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2">&nbsp;</td>
                </tr>
                <tr>
                    <td>
                        نوع کالا
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlProducts" runat="server" DataTextField="ProductName" DataValueField="ProductId" AppendDataBoundItems="true">
                            <asp:ListItem Text="---" Value="-1" />
                        </asp:DropDownList>
                        <asp:CompareValidator ID="cvProducts" runat="server" ControlToValidate="ddlProducts"
                                              ValueToCompare="-1" Operator="NotEqual" ErrorMessage="*" ValidationGroup="SubmitOrder" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2">&nbsp;</td>
                </tr>
                <tr>
                    <td>
                        تاریخ سفارش
                    </td>
                    <td>
                        <asp:TextBox ID="txtOrderDate" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2">&nbsp;</td>
                </tr>
                <tr>
                    <td>
                        سریال کالا
                    </td>
                    <td>
                        <asp:TextBox ID="txtSerial" Width="200" runat="server" />
                    </td>
                </tr>

                <tr>
                    <td colspan="2">&nbsp;</td>
                </tr>
                <tr>
                    <td>
                        کد پرداخت
                    </td>
                    <td>
                        <asp:TextBox ID="txtPaymentCode" Width="200" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2">&nbsp;</td>
                </tr>
                <tr>
                    <td>
                        Password
                    </td>
                    <td>
                        <asp:TextBox ID="txtPassword" Width="200" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2">&nbsp;</td>
                </tr>
                <tr>
                    <td>
                        ISDN
                    </td>
                    <td>
                        <asp:TextBox ID="txtISDN" Width="200" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2">&nbsp;</td>
                </tr>
                <tr>
                    <td>
                        DEPTCode
                    </td>
                    <td>
                        <asp:TextBox ID="txtDeptCode" Width="200" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2">&nbsp;</td>
                </tr>
                <tr>
                    <td>
                        SUBID
                    </td>
                    <td>
                        <asp:TextBox ID="txtSubID" Width="200" runat="server" />
                    </td>
                </tr>

                <tr>
                    <td colspan="2">&nbsp;</td>
                </tr>
                <tr>
                    <td colspan="2">&nbsp;</td>
                </tr>
                <tr>
                    <td colspan="2">
                        <asp:Button ID="btnSubmitOrder" runat="server" Text="سفارش" onclick="btnSubmitOrder_Click" ValidationGroup="SubmitOrder" />
                    </td>
                </tr>
            </table>

        </asp:Panel>
    </div>
</asp:Content>
